package activity;

import com.qzhy.female.R;

import Constant.Constance;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import utils.SetUtils;

public class SetActivity extends ActionBarActivity implements OnClickListener {

	private ImageView mImgBack;
	private RelativeLayout mRtlUpdateInfo;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_set);
		InitUI();
	}

	private void InitUI() {
		Button mBtnExist=(Button) findViewById(R.id.btn_exist);
		mBtnExist.setOnClickListener(this);
		
		mImgBack = (ImageView) findViewById(R.id.img_finish);
		mImgBack.setOnClickListener(this);
		
		mRtlUpdateInfo = (RelativeLayout) findViewById(R.id.rtl_update_info);
		mRtlUpdateInfo.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_exist:
			SetUtils.saveLoginState(getApplicationContext(), false);
			Intent data=new Intent();
			setResult(Constant.Constance.INTENT.LOGIN_SET, data);
			finish();
			break;
		case R.id.img_finish:	
			Intent date = new Intent();
			setResult(Constance.INTENT.SET_BACK, date);
			finish();
			break;
		case R.id.rtl_update_info:	
			startActivity(new Intent(this,UpdateUserInfoActivity.class));
			break;
		default:
			break;
		}
	}
}
